package cn.medemede.k2;


public class Rectangle implements Shape {
    String name;
    double x;
    double y;

    Rectangle(double x, double y) {
        name="矩形";
        this.x = x;
        this.y = y;
    }

    Rectangle() {
        name="矩形";
    }

    @Override
    public double area() {
        return x*y;
    }

    @Override
    public double perimeter() {
        return (x+y)*2;
    }

    @Override
    public void show() {

    }
    @Override
    public String toString() {
        return "Rectangle{" +
                "x=" + x +
                ", y=" + y +
                ", name='" + name + '\'' +
                '}';
    }
}
